package com.iotechn.unimall.admin.api.news;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.NewsDO;
import com.iotechn.unimall.data.model.Page;

/**
 * 新闻
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-07-15 20:27:55
 */
@HttpOpenApi(group = "admin.news", description = "")
public interface AdminNewsService {

    @HttpMethod(description = "列表", permission = "list", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public Page<NewsDO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "搜索标题") String title,
            @HttpParam(name = "category", type = HttpParamType.COMMON, description = "搜索分类") String categoryId,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "") Integer type,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "创建", permission = "operation:news:create", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public NewsDO create(
            @NotNull @HttpParam(name = "newsDO", type = HttpParamType.COMMON, description = "") NewsDO newsDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "operation:news:update", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public String update(
            @NotNull @HttpParam(name = "newsDO", type = HttpParamType.COMMON, description = "") NewsDO newsDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "operation:news:edit", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public NewsDO edit(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "删除", permission = "operation:news:delete", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "operation:news:batchdelete", permissionParentName = "企业信息", permissionName = "新闻资讯")
    public String batchDelete(
            @NotNull @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "新闻Id") String ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

}

